import request from '@/utils/request'

// 查询质控 列表
export function listQualityControl(query) {
  return request({
    url: '/research/qualityControl/list',
    method: 'get',
    params: query
  })
}

// 查询关联质控条目
export function getLinkEntryIds(qcId) {
  return request({
    url: '/research/qualityControl/getLinkEntryIds/' + qcId,
    method: 'get'
  })
}

// 查询关联质控条目
export function getLinkEntries(qcId) {
  return request({
    url: '/research/qualityControl/getLinkEntries/' + qcId,
    method: 'get'
  })
}

// 新增、修改 质控-条目
export function handleLinkEntry(data) {
  return request({
    url: '/research/qualityControl/handleLinkEntry',
    method: 'post',
    data: data
  })
}

// 修改 质控关联的样本质量值
export function editQcSample(data) {
  return request({
    url: '/research/qualityControl/editQcSample',
    method: 'post',
    data: data
  })
}

// 查询关联样本
export function getLinkSample(qcId) {
  return request({
    url: '/research/qualityControl/getLinkSample/' + qcId,
    method: 'get'
  })
}

// 新增 质控-样本
export function addLinkSample(data) {
  return request({
    url: '/research/qualityControl/addLinkSample',
    method: 'post',
    data: data
  })
}

// 移除 质控-样本
export function removeLinkSample(data) {
  return request({
    url: '/research/qualityControl/removeLinkSample',
    method: 'post',
    data: data
  })
}

// 查询质控 详细
export function getQualityControl(qcId) {
  return request({
    url: '/research/qualityControl/' + qcId,
    method: 'get'
  })
}

// 新增质控
export function addQualityControl(data) {
  return request({
    url: '/research/qualityControl',
    method: 'post',
    data: data
  })
}

// 修改质控
export function updateQualityControl(data) {
  return request({
    url: '/research/qualityControl',
    method: 'put',
    data: data
  })
}

// 删除质控
export function delQualityControl(qcId) {
  return request({
    url: '/research/qualityControl/' + qcId,
    method: 'delete'
  })
}

// 导出质控
export function exportQualityControl(query) {
  return request({
    url: '/research/qualityControl/export',
    method: 'get',
    params: query
  })
}

// 获取质控报告
export function getReport(qcId) {
  return request({
    url: '/research/qualityControl/getReport/' + qcId,
    method: 'get'
  })
}
